# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=monolith
pkgver=2.8.3
pkgrel=0
pkgdesc="CLI tool for saving complete web pages as a single HTML file"
url="https://github.com/Y2Z/monolith"
# riscv64: rust is broken on this arch
arch="all !riscv64"
license="CC0-1.0"
makedepends="
	cargo
	cargo-auditable
	openssl-dev
	"
source="
	https://github.com/Y2Z/monolith/archive/v$pkgver/monolith-$pkgver.tar.gz
	cargo-update.patch
	"

# use system openssl
export OPENSSL_NO_VENDOR=1

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
bdfa3cb42da70e5a467e49edc7cb6d327d0cb9abb50c6b291e46c3e5e877fcfcf373867144c11b45b97b6ce0da4f00f7913c3684da0e75fa7b1e6fba70a32708  monolith-2.8.3.tar.gz
0fa90febcd4e026e02b1b09837daf4b6cfcf243999789de93e4b382764026bbd5d195eba7ac03a33dc1285efacc34aafaa64bf6869a6e20f142ba9e4116e587f  cargo-update.patch
"
